package com.digitalxpert.jargle.persistence;
import java.io.Serializable;
import java.util.Collection;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
@Entity
@Table(name = "PACKAGE")
public class JGPackage implements Serializable {
	private Long id;
	private String pkgName;
	private JGApplication app;
	private Collection<JGClass> classes;
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "ID")
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	@Column(name = "PACKAGE_NAME")
	public String getPkgName() {
		return pkgName;
	}
	public void setPkgName(String pkgName) {
		this.pkgName = pkgName;
	}
	@OneToMany(cascade = CascadeType.ALL, mappedBy = "pkgs")
	public Collection<JGClass> getClasses() {
		return classes;
	}
	public void setClasses(Collection<JGClass> classes) {
		this.classes = classes;
	}
	@ManyToOne
    @JoinColumn(name = "APP_ID", insertable = false, updatable = false)
	public JGApplication getApp() {
		return app;
	}
	public void setApp(JGApplication app) {
		this.app = app;
	}
}
